feat(document): use matching markdown file as folder page content#58
Open
geopanther wants to merge 2 commits into
Open
feat(document): use matching markdown file as folder page content#58geopanther wants to merge 2 commits into
geopanther wants to merge 2 commits into
Conversation
When a markdown file shares its stem with a sibling directory (e.g., sub-folder.md next to sub-folder/), use its content as the body of the folder page instead of creating an empty folder page and a separate content page. The markdown file is excluded from normal page processing to avoid duplication. Adapted from iamjackg/md2cf#141 by @sheyifan.
Owner
Author
Maintainer ReviewVerdict: Useful feature — many documentation systems (MkDocs, Hugo) use this convention. However, this is implicit behavior that could surprise users. Good:
Concerns:
Recommendation: Consider making this opt-in. The implicit behavior matches some static site generators but could surprise Confluence users who intentionally have both a folder and a file with the same name for different purposes. |
When a markdown file shares its stem with a sibling directory (e.g., sub-folder.md next to sub-folder/), use its content as the body of the folder page instead of creating an empty folder page and a separate content page. Opt-in via --use-folder-content-file flag. Labels from the matching file's front matter are passed through to the folder page. Adapted from iamjackg/md2cf#141 by @sheyifan.
Owner
Author
|
Updated — addressed all review feedback:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a markdown file shares its stem with a sibling directory (e.g.,
sub-folder.mdnext tosub-folder/), use its content as the body of the folder page instead of creating an empty folder page and a separate content page.Opt-in via
--use-folder-content-fileflag — no implicit behavior change.Adapted from iamjackg/md2cf#141 by @sheyifan.
Changes
--use-folder-content-file(opt-in)Differences from upstream
Tests
test_get_pages_from_directory_folder_content_from_matching_md— verifies opt-in behaviortest_get_pages_from_directory_folder_content_disabled_by_default— verifies no change without flag